package com.matrix.java.chap_04;

import java.util.Scanner;

/*
    电话键盘
 */
public class Ex4_15 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter a letter: ");
        String letter = input.next();
        if ("☺".contains(letter)) {
            System.out.println("1");
        } else if ("ABCabc".contains(letter)) {
            System.out.println("2");
        } else if ("DEFdef".contains(letter)) {
            System.out.println("3");
        } else if ("GHIghi".contains(letter)) {
            System.out.println("4");
        } else if ("JKLjkl".contains(letter)) {
            System.out.println("5");
        } else if ("MNOmno".contains(letter)) {
            System.out.println("6");
        } else if ("PQRSpqrs".contains(letter)) {
            System.out.println("7");
        } else if ("TUVtuv".contains(letter)) {
            System.out.println("8");
        } else if ("WXYZwxyz".contains(letter)) {
            System.out.println("9");
        } else {
            System.out.println(letter + " is an invalid input");
        }
        input.close();
    }
}
